// See https://sequelize.org/master/manual/model-basics.html
// for more of what you can do here.
const Sequelize = require('sequelize');
const DataTypes = Sequelize.DataTypes;

module.exports = function (app) {
  const sequelizeClient = app.get('sequelizeClient');
  const kfc = sequelizeClient.define('kfc', {
    a: DataTypes.STRING,
    b: DataTypes.DECIMAL(10, 2), // mysql decimal声明的类型是浮点一般就是 金额相关 (10整数部分，2小数点位数),
    c: DataTypes.STRING
   
  }, {
    hooks: {
      beforeCount(options) {
        options.raw = true;
      }
    }
  });

  // eslint-disable-next-line no-unused-vars
  kfc.associate = function (models) {
    // Define associations here
    // See https://sequelize.org/master/manual/assocs.html
  };

  return kfc;
};
